package adv2;

import java.util.Arrays;
import java.util.List;

public class ArrTest {

	public static void main(String[] args) {
		int[] ar = { 34, 23, 13, 15, 14, 20, 1 };
		System.out.println(Arrays.toString(ar));
		Arrays.sort(ar);
		System.out.println(Arrays.toString(ar));

		List<String> list = Arrays.asList("wo", "like", "java");
		System.out.println(list);
		// 找位置必须排序后的
		int pos = Arrays.binarySearch(ar, 23);
		System.out.println("23所在的位置是：" + pos);
		int p2 = Arrays.binarySearch(ar, 65);
		System.out.println("65所在的位置是：" + p2);

		int[] a3 = Arrays.copyOf(ar, 30);
		System.out.println(Arrays.toString(a3));

	}

}
